{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox-title">
        <h5>赠送比例</h5>
    </div>
    <div class="ibox-content layui-form">
        <div class="layui-row layui-col-space10 layui-form-item ">
            <input type="hidden" name="shop_id" value="{$shop.shop_id ? $shop.shop_id : ''}">
            <!-- <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">赠送比例：</label>
                <div class="layui-input-block">
                    <input type="text" name="value" placeholder="子账号" class="layui-input ">
                </div>
            </div> -->
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">赠送比例：</label>
                <div class="layui-input-inline">
                    <select name="value" lay-verify="required">
                        <!--<option value="1" {if condition="$shop.shop_ratio == 1"} selected="selected" {/if}>1折</option>-->
                        <!--<option value="2" {if condition="$shop.shop_ratio == 2"} selected="selected" {/if}>2折</option>-->
                        <!--<option value="3" {if condition="$shop.shop_ratio == 3"} selected="selected" {/if}>3折</option>-->
                        <!--<option value="4" {if condition="$shop.shop_ratio == 4"} selected="selected" {/if}>4折</option>-->
                        <!--<option value="5" {if condition="$shop.shop_ratio == 5"} selected="selected" {/if}>5折</option>-->
                        <!--<option value="6" {if condition="$shop.shop_ratio == 6"} selected="selected" {/if}>6折</option>-->
                        <option value="9.8" {if condition="$shop.shop_ratio == 9.8"} selected="selected" {/if}>9.8折</option>
                        <option value="9.5" {if condition="$shop.shop_ratio == 9.5"} selected="selected" {/if}>9.5折</option>
                        <option value="9" {if condition="$shop.shop_ratio == 9"} selected="selected" {/if}>9折(推荐)</option>
                        <option value="8.5" {if condition="$shop.shop_ratio == 8.5"} selected="selected" {/if}>8.5折</option>
                        <option value="8" {if condition="$shop.shop_ratio == 8"} selected="selected" {/if}>8折</option>
                        <option value="7.5" {if condition="$shop.shop_ratio == 7.5"} selected="selected" {/if}>7.5折</option>
                        <option value="7" {if condition="$shop.shop_ratio == 7"} selected="selected" {/if}>7折</option>
                        <option value="" {if !$shop.shop_ratio} selected {/if}>无折扣（上级合伙人不再有1/‰奖励）</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                    </button>
                    <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/footer" /}
<script>
    layui.use(['form'], function() {
        var form = layui.form;
        
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('ratio')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('shop/index')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\')');
                    }
                }
            })
        });
    });
</script>
</body>
</html>